<%@ page import="com.dao.GoodsDao" %>
<%@ page import="com.beans.GoodsInfo" %>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%
    String path = request.getContextPath();
    String basePath = request.getScheme() + "://" + request.getServerName() + ":" + request.getServerPort() + path + "/";
%>
<html>
<head>
    <base href="<%=basePath%>">
    <title>Title</title>
</head>
<body>
<%
    int goodsId= Integer.parseInt(request.getParameter("goodsId"));
    GoodsDao dao=new GoodsDao();
    GoodsInfo goods=  dao.getGoodsById(goodsId);
    response.setContentType("image/jpg");

    ServletOutputStream outstream =response.getOutputStream();
    outstream.write(goods.getPictureData());
    out.clear();
    out=pageContext.pushBody();
%>
</body>
</html>
